<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    < <title>Title</title>
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
    <script src="js/jquery.params.js" type="text/javascript"></script>
    <script type="text/javascript">
        var fixLogId=$.query.get("fixLogId");
        $.ajax({
            url:'admin/stock/findFixLogByID',
            data:JSON.stringify(fixLogId),
            type:'POST',
            dataType:'json',
            /*
           声明参数位json类型，便于后台接收时可以识别
            */
            headers:{
                Accept:"application/json",
                "Content-Type":"application/json"
            },
            processData:false,
            cache:false
        }).done(function (data) {
            printFixingLogInfo(data.fixlog[0]);
        });
        function  printFixingLogInfo(fixedLogInfo) {
            var fixedResult="已修好";
            if (fixedLogInfo.state!=1){
                fixedResult="未修好";
            }
            var fixedLogInfoInHTML=" <li><label>产品名</label><input id=\"productname\" readonly=\"readonly\"\n" +
                "                                             value=\""+fixedLogInfo.productname+"\" type=\"text\" class=\"dfinput\"/><i></i></li>\n" +
                "                <li><label>报修原因</label><input type=\"text\" readonly=\"readonly\" value=\""+fixedLogInfo.reason+" \"\n" +
                "                                              class=\"dfinput\"/><i></i></li>\n" +
                "                <li><label>客户姓名</label><input readonly=\"readonly\" type=\"text\"\n" +
                "                                              value=\""+fixedLogInfo.customername+"\" class=\"dfinput\"/><i></i></li>\n" +
                "                <li><label>联系电话</label><input readonly=\"readonly\" type=\"number\" value=\""+fixedLogInfo.customerphone+"\"\n" +
                "                                              class=\"dfinput\"/><i></i></li>\n" +
                "                <li><label>客户地址</label><textarea readonly=\"readonly\" cols=\"\" rows=\"\"\n" +
                "                                                 class=\"textinput\">"+fixedLogInfo.customeraddress+"</textarea></li>\n" +
                "                <li><label>维修人</label>\n" +
                "                    <input type=\"text\" readonly=\"readonly\" value=\""+fixedLogInfo.workername+"\" class=\"dfinput\"/>\n" +
                "                    <i></i></li>\n" +
                "                <li><label>工号</label>\n" +
                "                    <input type=\"text\" readonly=\"readonly\" value=\""+fixedLogInfo.username+"\" class=\"dfinput\"/>\n" +
                "                    <i></i></li>\n" +
                "                <li><label>工作时长</label>\n" +
                "                    <input type=\"text\" readonly=\"readonly\" value=\""+new Date(fixedLogInfo.borrowtime).toLocaleString()+"至"+new Date(fixedLogInfo.returntime).toLocaleString()+"\"\n" +
                "                           class=\"dfinput\"/>\n" +
                "                    <i></i></li>\n" +
                "                <li><label>使用工具</label>\n" +
                "                    <input type=\"text\" readonly=\"readonly\" value=\""+fixedLogInfo.toolname+"-"+fixedLogInfo.toolcount+"个\"\n" +
                "                           class=\"dfinput\"/>\n" +
                "                    <i></i></li>\n" +
                "                <li><label>带走配件</label>\n" +
                "                    <input type=\"text\" readonly=\"readonly\" value=\""+fixedLogInfo.partsname+"-"+fixedLogInfo.partscount+"个\"\n" +
                "                           class=\"dfinput\"/>\n" +
                "                    <i></i></li>\n" +
                "                <li><label>入库旧件</label>\n" +
                "                    <input type=\"text\" readonly=\"readonly\" value=\""+fixedLogInfo.oldparts+"-"+fixedLogInfo.opcount+"个\"\n" +
                "                           class=\"dfinput\"/>\n" +
                "                    <i></i></li>\n" +
                "                <li><label>工人奖金</label><input name=\"bonus\" type=\"text\" value=\""+fixedLogInfo.bonus+"\" readonly=\"readonly\"\n" +
                "                                              class=\"dfinput\"/><i></i></li>\n" +
                "                <li><label>维修费用</label><input name=\"cost\"  value=\""+fixedLogInfo.cost+"\" readonly=\"readonly\" type=\"number\"\n" +
                "                                              class=\"dfinput\"/><i></i></li>\n" +
                "                <li><label>维修结果</label><input   value=\""+fixedResult+"\" readonly=\"readonly\" type=\"text\"\n" +
                "                                                        class=\"dfinput\"/><i></i></li>\n" +
                "                <li><label>&nbsp;</label><input type=\"button\" onclick='returnToFixedLogList()' class=\"btn\" value=\"确认\"/></li>";
            $("#fixedLogTable").append(fixedLogInfoInHTML);
        }
    </script>
</head>


<div class="place">

    <div class="formbody">
        <form id="fixedLogForm">
            <div class="formtitle"><span>维修日志</span></div>
            <ul class="forminfo" id="fixedLogTable">

            </ul>

        </form>
    </div>
</div>
<script type="text/javascript">
    function returnToFixedLogList() {
        window.location.href="/fixloged.html"
    }
</script>
</html>